import { getTeamGroupList, getTeamDetectPlanList} from '@services/index';

const routePath = location.pathname;
const rNameArr = routePath.split('-');

export const getTeamGroup = async (params: any) => {
    let datas, newParams = {
        ...params,
        projectId: JSON.parse(sessionStorage.userInfo).projectId
    };
    switch(rNameArr[1]) {
        case 'prospectus': // 探测计划评测
            datas = await getTeamGroupList(newParams);
            break;
        // case 'prospectus': // 探测计划评测
        //     datas = await getTeamGroupList(newParams);
        //     break;
        default:
            datas = await getTeamGroupList(newParams);
            break;
    }
    const { data, status } = await getTeamGroupList(newParams);;
    if(status === '0'){
        return data
    }
}